@extends('layouts.backend')
@section('title')
    会员列表
@endsection

@section('body')
    <div class="row">
        <div class="ibox">
            <div class="ibox-title">
                <h5>会员列表</h5>
            </div>
            <div class="ibox-content">
                <div class="row">
                    <div class="col-md-6">
                        <form role="form" class="form-inline" method="get">
                            <div class="form-group">
                                <label for="keyword" class="sr-only">Name/Email</label>
                                <input type="text" placeholder="Enter name or email " value="{{request('keyword', '')}}" name="keyword" id="keyword" class="form-control">

                            </div>
                            <button class="btn btn-primary" type="submit">搜索</button>
                            <a href="{{ route('backend.member.index') }}" class="btn btn-warning">重置</a>
                        </form>
                    </div>
                    <div class="col-md-6">
                        <a href="{{route('backend.member.create')}}" class="btn btn-primary pull-right">添加会员</a>
                    </div>
                </div>
                <table class="table">
                    <thead>
                    <tr>
                        <th>#</th>
                        <th>Name</th>
                        <th>Email</th>
                        <th>手机</th>
                        <th>是否锁定</th>
                        <th>是否激活</th>
                        <th>注册时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @forelse($members as $member)
                        <tr>
                            <td>{{$member->id}}</td>
                            <td><img src="{{$member->avatar}}" alt="" class="img-circle img-md m-sm">{{$member->name}}</td>
                            <td>{{$member->email}}</td>
                            <td>{{$member->mobile}}</td>
                            <td>@if($member->is_lock>-1)
                                    <span class="badge badge-info">是</span>
                                @else
                                    <span class="badge badge-danger">否</span>
                                @endif
                            </td>
                            <td>@if($member->email_verified_at)
                                    <span class="badge badge-info">是</span>
                                @else
                                    <span class="badge badge-danger">否</span>
                                @endif</td>
                            <td>{{$member->created_at}}</td>
                            <td>
                                @include('components.backend.destroy', ['url' => route('backend.member.destroy', $member),'label'=>'锁定'])
                            </td>
                        </tr>
                    @empty
                        <tr>
                            <td class="text-center" colspan="7">暂无记录</td>
                        </tr>
                    @endforelse
                    </tbody>
                </table>
            </div>
            <div class="ibox-footer">
                {{$members->render()}}
            </div>
        </div>
    </div>
@endsection
